//
//  StarInfoView.m
//  Mango
//
//  Created by lanou3g on 16/5/14.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "StarView.h"

@interface StarView ()
@property (weak, nonatomic) IBOutlet UIImageView *bgImgView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *enNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *birLabel;
@property (weak, nonatomic) IBOutlet UILabel *descLabel;

@end

@implementation StarView
+ (instancetype)infoView {
    return [[[NSBundle mainBundle]loadNibNamed:@"StarView" owner:nil options:nil]lastObject];
}

- (void)setModel:(StarInfoModel *)model {
    if (_model != model) {
        _model = model;
        NSString *bgpic = [model.bgpic componentsSeparatedByString:@"?"][0];
        [self.bgImgView sd_setImageWithURL:[NSURL URLWithString:bgpic] placeholderImage:[UIImage imageNamed:@"placeholder"]];
        self.nameLabel.text = model.name;
        self.enNameLabel.text = model.engname;
        self.birLabel.text = model.bir;
        self.descLabel.text = model.Description;
    }
}

#pragma mark 切换至日间模式
-(void)updateToNightSkinMode {
    self.nameLabel.textColor = [UIColor grayColor];
    self.enNameLabel.textColor = [UIColor grayColor];
    self.birLabel.textColor = [UIColor grayColor];
    self.descLabel.textColor = [UIColor grayColor];
}

//-(void)updateToDaySkinMode {
//    self.nameLabel.textColor = [UIColor blackColor];
//    self.enNameLabel.textColor = [UIColor blackColor];
//    self.birLabel.textColor = [UIColor blackColor];
//    self.descLabel.textColor = [UIColor blackColor];
//}

@end
